package com.leyou.item.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.leyou.item.entity.Category;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

import java.util.List;

public interface CategoryMapper extends BaseMapper<Category> {

    @Select("select c.* from tb_category c\n" +
            "left join tb_category_brand cb on c.id = cb.category_id\n" +
            "where cb.brand_id = #{brandId}")
    List<Category> queryCategoryByBrandId(@Param("brandId") Long brandId);
}
